package mr.ali.webvideo.controller;


import com.github.pagehelper.PageInfo;
import mr.ali.webvideo.model.CollectionPlay;
import mr.ali.webvideo.service.ICollectionPlayService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Mr-ali
 * @since 2025-08-16
 */
@RestController
@RequestMapping("/h5/collectionPlay")
public class CollectionPlayController {
    @Resource
    private ICollectionPlayService collectionPlayService;
    /**
     * 获取数据*/
    @GetMapping("/findAll")
    public PageInfo<CollectionPlay> findAll(Integer pageNum, Integer pageSize , Integer tags){
        return collectionPlayService.findAllByOrderLastPlay(pageNum,pageSize ,tags);
    }


    /**
     * 标题来模糊查询
     */
    @GetMapping("/search")
    public PageInfo<CollectionPlay> searchCollections(String name, Integer pageNum, Integer pageSize) {
        char c = name.charAt(0);
        //            中文的时候才出发搜索
//        if (isChineseCharacter(c)) {
           return collectionPlayService.searchCollections(name, pageNum, pageSize);
//        }
//        return null;
    }
}
